<div class="page-content" >
	<div class="panel panel-default">
		<div class="panel-heading">
			<ul class="breadcrumb">
                    <li><a href="<{:U('index')}>">商户设置</a> </li>
                    <li class="active"><if condition="$data.store_wechat eq ''">添加商户<else />修改商户</if></li>
           </ul>
		</div>
		<div class="panel-body">
			 <form id="myform" enctype="multipart/form-data" class="form-horizontal" method="post" action="<{:U('storeInsert')}>">
                        <input type="hidden" name="store_id" value="<{$data.store_id}>">
                    
                            <div class="form-group" style="">
                                <label for="input-title" class="col-sm-2 control-label" style="" >商城LOGO：</label>
                                <div class="col-sm-7">
								 <div id="preview"></div>
								<input type="file" id="showflag"  name="img"   />
                                 
                                    <img  id="showimg"  <if condition="$data['logo']"> src="__Img__<{$data.logo}>" </if>  width="50" style="display: inline;"/>
                                    (Logo尺寸大小宽度120px ,高度40px ,只能是png类型透明图片)
                                </div>
                            </div>

                             <div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">商户名</label>
                                <div class="col-sm-7">
                            
                                    <input type="text" class="form-control"  name="store_name"  value="<{$data.store_name}>">
                                
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">域名</label>
                                <div class="col-sm-7">
                            
                                    <input type="text"  id="domain" class="form-control"  name="domain"  value="<{$data.domain}>">
                                
                                </div>
                            </div>
                            
                             <div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">登陆帐户</label>
                                <div class="col-sm-7">
                            
                                    <input type="text" class="form-control"  name="user_name"  value="<{$user_data.user_name}>">
                                
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">密码</label>
                                <div class="col-sm-7">
                            
                                    <input type="text" class="form-control"  name="password"  value="">
                                
                                </div>
                            </div>
							 
							   <div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">联系电话</label>
                                <div class="col-sm-7">
                                    <input type="text" class="form-control" id="appID" name="photo" value="<{$data.photo}>">
                            
                                </div>
                            </div>
							<div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">公司地址</label>
                                <div class="col-sm-7">
                                    <input type="text" class="form-control" id="address" name="address" value="<{$data.address}>">
                            
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label for="input-title" class="col-sm-2 control-label">邮箱</label>
                                <div class="col-sm-7">
                                    <input type="text" class="form-control" id="address" name="email" value="<{$data.email}>">
                            
                                </div>
                            </div>
                             
							<div class="form-group">
					<div class="col-sm-offset-2 col-sm-7">
						<button type="submit" class="btn btn-primary">保存</button>
					</div>
				</div>
     
 
                     </form>
		</div>
	</div>
</div>
<script>
 
$(function(){
    $(".form-horizontal").bootstrapValidator({
        message: '您填入的值不合法',
        fields:{
            domain: {
                message: '域名',
                validators: {
                    notEmpty: {
                        message: '域名不能为空'
                    },
					 remote: {
                        message: '域名被抢先注册了',
                        url: "<{:U('System/checkdomain')}>",
						 data:{ 
							 domain: function(){ return $("#domain").val(); },
							 store_id: '<{$data.store_id}>',
						 }
                    },
                }
            },
			store_name: {
                message: '商户名',
                validators: {
                    notEmpty: {
                        message: '商户名不能为空'
                    },
                }
            },
			 
			  

        }
    });
	
 
});
 </script> 

 <script type="text/javascript">
    var ajaxUrl='<{:U("logo_up")}>';
</script>
<script type="text/javascript" src="__PUBLIC__/Js/ajaxup.js"></script>